<?php
//Villan0va@Junction
//3v3rn0t3
	session_start();

	$token = md5(uniqid(rand(), true));
	$_SESSION['token'] = $token;

?>
<!DOCTYPE html>

<!--[if IEMobile 7 ]><html class="MIEM7 no-js" lang="en" ><![endif]-->
<!--[if IEMobile 8 ]><html class="MIEM8 no-js" lang="en" ><![endif]-->
<!--[if IEMobile 9 ]><html class="MIEM9 no-js" lang="en" ><![endif]-->
<!--[if !(IEMobile) ]><!--><html class="no-js" lang="en" ><!--<![endif]-->

<head>

	<!-- METAS -->
	<meta charset="utf-8" />

	<title>mobile aerodrome information service</title>

	<meta name="author" content="mobile aerodrome information service" />
	<meta name="description" content="mobile aerodrome information service" />

	<!-- METAS -->
	<meta itemprop="name" content="mobile aerodrome information service" />
	<meta itemprop="description" content="mobile aerodrome information service" />
	<meta itemprop="image" content="" />

	<meta property="og:type" content="website" />
	<meta property="og:url" content="http://wx.devenv.us" />
	<meta property="og:site_name" content="mobile aerodrome information service" />

	<meta property="og:title" content="mobile aerodrome information service" />
	<meta property="og:description" content="mobile aerodrome information service" />

	<meta property="og:image" content="" />
	<meta property="og:image:secure_url" content="" />
	<meta property="og:locale" content="en_US" />

	<!-- PHONE -->
	<meta name="mobileoptimized" content="320" />
	<meta name="handheldfriendly" content="true" />
	<meta name="viewport" content="
				width=device-width,
				minimum-scale=1.0,
				maximum-scale=1.0,
				initial-scale=1.0,
				user-scalable=no"
				/>

	<!-- APPLE -->
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
	<meta name="format-detection" content="telephone=yes" />

	<!-- MSIES -->
	<meta http-equiv="cleartype" content="on" />

	<!-- FAVOR -->
	<link rel="apple-touch-startup-image" type="image/png" href="apple.start.image.png?v0.800" />
	<link rel="apple-touch-icon-precomposed" type="image/png" href="apple.touch.icon.a.png?v0.800" />
	<link rel="apple-touch-icon-precomposed" type="image/png" href="apple.touch.icon.d.png?v0.800" sizes="144x144" />
	<link rel="apple-touch-icon-precomposed" type="image/png" href="apple.touch.icon.c.png?v0.800" sizes="114x114" />
	<link rel="apple-touch-icon-precomposed" type="image/png" href="apple.touch.icon.b.png?v0.800" sizes="72x72" />
	<link rel="apple-touch-icon-precomposed" type="image/png" href="apple.touch.icon.a.png?v0.800" sizes="57x57" />


	<!-- JSONS -->
	<script type="text/javascript" src="js/xui.js"></script>
	<script type="text/javascript" src="js/modernizr-2.0.6.min.js"></script>
	<script type="text/javascript" src="js/geo.js"></script>
	<script type="text/javascript" src="js/edge.js"></script>
	<script type="text/javascript" src="js/helper.js"></script>
	<script type="text/javascript" src="js/persistent.js"></script>
	<!--<script type="text/javascript" src="js/downstream.js"></script>-->
	<script type="text/javascript" src="js/bookmark_bubble.js"></script>
	<script type="text/javascript" src="js/script.js"></script>


	<!-- FONTS -->
	<script src="http://use.edgefonts.net/marvel.js"></script>
	<script src="http://use.edgefonts.net/share-regular.js"></script>
    <link rel="stylesheet" href="css/fontello.css"><!--[if IE 7]>
    <link rel="stylesheet" href="css/fontello-ie7.css"><![endif]-->

    <!-- STYLES -->
	<link rel="stylesheet" type="text/css" href="css/styles.css" />


</head>

<body class="home">

	<header>
	  	<div class="container clearfix">
	    	<p id="branding">mobile aerodrome information service</p>
	    	<h1>all in one</h1>
	    	<section id="buttons" class="clearfix">
	      		<a href="#" id="find_aerodrome" class="button left"><i class="icon-search-1"></i><span>find aerodrome</span></a>
	      		<a href="#favs" id="favorites" class="button right"><i class="icon-heart-empty"></i><span>favorites</span></a>
	    	</section>
	  	</div>
	  	<section role="thumb">
	    	<div class="flickr_badge_image">
				<script type="text/javascript" src="http://www.flickr.com/badge_code_v2.gne?count=1&display=random&size=m&layout=x&source=user_set&set=72157601415320418">
				</script>
			</div>
	  	</section>
	</header>

	<section role="search">
	  	<form action="views/aerodrome.php" method="post" id="search_form">
		    <input name="request[keywords]" id="searchBox" type="search" value="search aerodromes" autocorrect="off" autocapitalize="off">
	    	<input name="request[token]" type="hidden" value="<?php echo $token;?>">
	  	</form>
	</section>

	<section role="main">
		<a name="favs"></a>
	  	<div class="container">
	    	<section id="closest" class="clearfix">
	      			<h1>~ your favourites ~</h1>
	      			<span class="resultset"></span>
	    	</section>
	  	</div>
	</section>

	<!--
	<section id="location_wrap">
	  <div class="container">
	    <h1>location</h1>
	    <p id="location">Albertson, NC</p>
	    <a href="/locations" class="button">change your location</a>
			<p><a id="use_current_link" href="/locations/gps/">use your current location</a></p>
		  </div>
	</section>
	-->

	<footer role="contentinfo" class="clearfix">
		<div class="container">
	    	<p id="footer_social">
	      		<a href="http://facebook.com/"><i class="icon-facebook"></i></a>&nbsp;
	      		<a href="http://twitter.com/"><i class="icon-twitter"></i></a>
	    	</p>
	    	<ul>
	      		<li><a href="/feedback">feedback</a></li>
	      		<li><a href="/events">social</a></li>
	      		<li><a href="/favorites">credits</a></li>
	    	</ul>
	    	<a href="#" id="full_site">Settings</a>
	    	<p><small>Disclaimer : Pilots are advised to obtain an interpretative weather briefing and all pertinent NOTAM from Flight Information Centres / Flight Service Stations (FIC/FSS) prior to flying. The user accepts sole responsibility and all risks associated with use of the information on this web site. The user expressly releases THIS JOINT, its employees, agents and assigns from any liability or obligation in respect thereof.</small></p>
	  	</div>
	</footer>


	<script type="text/javascript">
	  // iOS scale bug fix
		MBP.scaleFix();
		MBP.hideUrlBar();

		// Hide the address bar!
		(function() {
			setTimeout(function(){
				window.scrollTo(0, 1);
			}, 0);
		});

	
		x$.ready(function(){

		// Init js framework
			wxMobile.initialize({
				"denied":0,
				"unavailable":0,
				"lat":"36.0329",
				"lng":"-79.4872",
				"city_id":"1851",
				"city":"Alamance",
				"county_id":"181",
				"area_id":"150",
				"user":1,
				"modified":1347143272,
				"distance":null
			});


		// Search link
			x$('#find_aerodrome').on('click', function(){
				x$('#searchBox')[0].focus();
			});


		// Populating recent searches	
			var searchStorage = wxMobile.fetchSearchStorage();
			if (searchStorage || searchStorage !== null) {
				for (var i = searchStorage.length - 1; i >= 0; i--) {
					x$('.resultset').html("bottom", 
						"<article class='show'>" +
							//"<div class='distance'>7<small>times</small></div>" +
							"<div class='recent_search'>" +
								"<a href='#'>" +
									searchStorage[i][0] +
								"</a>" +
							"</div>" +
							"<div class='remove_search'><i class='icon-cancel-circle2'></i>" +
						"</article>"
					);
				};				
			} else {
				x$('.resultset').html("<p>Don't be shy, search for something.</p>")
			}
			// Making links clickable, submitting the form
			x$('.resultset > article').on('click', function () {
				x$('#searchBox').attr('value', x$(this).find('a').html());
				x$('#search_form')[0].submit();
			});
		});
	</script>
</body>
</html>